package com.onesports.intelligent.k12.polarlight.mapper.sys;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.onesports.intelligent.k12.polarlight.domain.entity.sys.Account;
import com.onesports.intelligent.k12.polarlight.domain.vo.sys.UnitAccountVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AccountMapper extends BaseMapper<Account> {

    /**
     * 分页查询单位账号权限管理列表
     *
     * @param page           分页参数
     * @param phone          手机号
     * @param username       姓名
     * @param organizationId 所属单位id
     * @return IPage<UnitAccountVO>
     */
    IPage<UnitAccountVO> selectUnitAccount(@Param("page") Page<UnitAccountVO> page, @Param("phone") String phone, @Param("username") String username, @Param("organizationId") String organizationId);

    @Deprecated
    Account getByPhoneNsystemCode(@Param("phone") String phone);

    List<String> getRole(String accountId);

    /**
     * 获取职工角色
     *
     * @return List<Account>
     */
    List<Account> getStaffRole();

    List<Account> listOrgsByKeyParams(@Param("phone") String phone, @Param("status") Boolean status);

    List<Account> getAccounts(String accountId);

    Account getSuperByOrganizationId(String organizationId);
}